﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NPOI.HSSF.UserModel;

namespace PhoobearLibs.Resource.Resx
{
    public static class HSSFSheetExtension
    {
        public static HSSFCell Cell(this HSSFSheet sheet, int row, int col)
        {
            HSSFRow dataRow = sheet.GetRow(row);
            if (dataRow == null)
            {
                dataRow = sheet.CreateRow(row);
                if (dataRow.GetCell(col) == null)
                {
                    return dataRow.CreateCell(col);
                }
            }
            else
            {
                if (dataRow.GetCell(col) == null)
                {
                    return dataRow.CreateCell(col);
                }
            }

            return dataRow.GetCell(col);
        }
    }
}
